package com.javatian.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截后台管理未登录用户的入库
 */
@Configuration
public class MyInterceptorConfig implements WebMvcConfigurer {

    //用户信息
    @Value("${const.user}")
    private String user;
    @Override
    public  void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new MyInterceptor(user)).addPathPatterns("/end/page/**")
                .excludePathPatterns("/end/page/login.html","/end/page/register.html");
    }


}
